var ctx = window.location.href;
ctx = ctx.substring(0, ctx.indexOf("firula/") + 6);

!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");

function loadPage(e, option){
	clearClass();
	$(e).addClass("menuButtonActive");

	$("#slideshow").css("display","none");
	$("#oque").css("display","none");
	$("#inovacoes").css("display","none");
	$("#mobilidade").css("display","none");
	$("#recrutamento").css("display","none");
	$("#redesSociais").css("display","none");

	if (option == 1){
		$("#content").removeClass("item");
		$("#slideshow").css("display","block");
	}else if (option == 2){
		$("#content").addClass("item");
		$("#content").css({"background":"url(./images/fundo-oquee.jpg)","background-size":"765px"});
		$("#oque").css("display","block");
	}else if (option == 3){
		$("#content").addClass("item");
		$("#content").css({"background":"url(./images/fundo-inovacoes.jpg)","background-size":"765px"});
		$("#inovacoes").css("display","block");
	}else if (option == 4){
		$("#content").addClass("item");
		$("#content").css({"background":"url(./images/fundo-mobilidade.jpg)","background-size":"765px"});
		$("#mobilidade").css("display","block");
	}else if (option == 5){
		$("#content").addClass("item");
		$("#content").css({"background":"url(./images/fundo-recrutamento.jpg)","background-size":"765px"});
		$("#recrutamento").css("display","block");
	}else if (option == 6){
		$("#content").addClass("item");
		$("#content").css({"background":"url(./images/branco.png)","background-size":"765px"});
		$("#redesSociais").css("display","block");
	}
}

function clearClass(){
	$("li").each(function(index) {
		$(this).removeClass("menuButtonActive");
	});
}

function slideshow(){
	$("#slider").easySlider({
		auto: true,
		continuous: true,
		numeric: true,
		speed: 2000,
		pause: 3000
	});
}

function changeInputTypeToPassword(e){
	e.value = '';
	e.type = 'password';
	e.focus();
}

$(document).ready(function(){	
	slideshow();
});
